package cn.chinaflame.pagodas.repository;

import cn.chinaflame.pagodas.entity.PaOrder;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

public interface PaOrderRepository extends JpaRepository<PaOrder, String>, JpaSpecificationExecutor<PaOrder> {

    @Query("select c from PaOrder c where c.id = ?1")
    public PaOrder findPaOrderById(String id);
    @Query("select c from PaOrder c where c.transType = 'PAY' and c.payStatus = ?1 and c.addTime < ?2")
    public List<PaOrder> findByPayStatusAndAddTime(String payStatus, String addTime);

}
